import {user_http} from './axios_user'

export const userHttp = {
    login(username: string, password: string) {
        return user_http.post('/user/login', {
            username: username,
            password: password
        })
    },
    getBindUser() {
        return user_http.get('/user/getBindUser', {
            id: JSON.parse(localStorage.getItem("user_info") + "").id
        })
    },

    addBindUser(username: string, server: string[], job: string) {
        return user_http.post('/user/setBindUser', {
            uId: JSON.parse(localStorage.getItem('user_info') + "").id,
            uName: username,
            uServer: server[0],
            uServer2: server[1],
            uJob: job
        })
    },
    updateDefaultUser(uid: string, bid: string) {
        return user_http.post('/user/setDefaultUser', {
            uid: uid,
            bid: bid
        })
    }
}
